package com.cbg.score.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.cbg.base.utils.Result;
import com.cbg.score.entity.ScScore;
import com.cbg.score.mapper.ScScoreMapper;
import com.cbg.score.service.IScScoreService;
import com.cbg.base.core.SuperServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yangkexiong
 * @since 2018-12-22
 */
@Service
public class ScScoreServiceImpl extends SuperServiceImpl<ScScoreMapper, ScScore> implements IScScoreService {
    @Autowired
    private IScScoreService scoreService;
    @Override
    //根据riderId查询分数实现
    public Result<ScScore> getIScore(String riderId) {
        ScScore score = getOne(new LambdaQueryWrapper<ScScore>().eq(ScScore::getId,riderId));
        if(ObjectUtil.isNull(score)){
            return Result.ok(score);
        }else {
            return Result.fail();
        }
    }
}
